package com.louis.kitty.admin.dao;

import java.util.List;

import com.louis.kitty.admin.model.SysUserVo;
import com.louis.kitty.admin.model.User;
import org.apache.ibatis.annotations.Param;

import com.louis.kitty.admin.model.SysUser;

public interface SysUserMapper {
    int deleteByPrimaryKey(Long id);

    int insert(SysUser record);

    int insertSelective(SysUser record);

    SysUser selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysUser record);

    int updateByPrimaryKey(SysUser record);
    /**
     * 分页查询用户
     * @return
     */
    List<SysUser> findPage();
    
    SysUser findByName(@Param(value="name") String name);
    
	List<SysUser> findPageByName(@Param(value="name") String name);
	
	List<SysUser> findPageByNameAndEmail(@Param(value="name") String name, @Param(value="email") String email);

    List<SysUser> findUsersByDept(@Param(value="deptId")Long deptId);

    List<SysUser> findUsersByRole(@Param(value = "roleIds")List<Long> roleIds);

    List<SysUserVo> findAllUsers();


    /**
     * 根据工号查找上级负责人信息，如果no是负责人
     * @param no 工号
     * @return
     */
    User findUpperByUserNoIfCharge(@Param("no") String no);

    /**
     * 根据工号查找上级负责人信息，no不是负责人
     * @param no 工号
     * @return
     */
    User findUpperUserByUserNoIfNoCharge(@Param("no") String no);

    List<SysUser> findAllUsersByCompanyId(Integer companyId);





}